{extend name="public/base" /}

{block name="body"}
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>消费记录</h2>
	</div>
	<div class="cf">
        <!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="number" class="search-input" value="{:input('number')}" placeholder="请输入查询订单号">
				<a class="sch-btn" href="javascript:;" id="search" url="{:url('Orders')}"><i class="btn-search"></i></a>
			</div>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th>用户名</th>
		<th class="">订单号</th>
		<th class="">支付宝交易号</th>
		<th class="">标题</th>
        <th class="">金额</th>
        <th class="">创建时间</th>
        <th class="">是否支付</th>
		</tr>
    </thead>
    <tbody>
		{notempty name="_list"}
		{volist name="_list" id="vo"}
		<tr>
			<td>{:get_username($vo.uid)}</td>
			<td>{$vo.number}</td>
			<td>{$vo.trade_no}</td>
            <td>{$vo.subject}</td>
            <td>{$vo.amount}</td>
            <td><span>{$vo.create_time|time_format}</span></td>
            <td style="{$vo.ispay == '1'?'':'color:red;'}">{$vo.ispay == '1'?'已支付':'未支付'}</td>
		</tr>
		{/volist}
		{else/}
		<td colspan="3" class="text-center"> aOh! 暂时还没有内容! </td>
		{/notempty}
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
{/block}

{block name="script"}
	<script src="__PUBLIC__/static/thinkbox/jquery.thinkbox.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav('{:url('User/index')}');
	</script>
{/block}
